package com.shigui.news.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shigui.news.dao.CommentDao;
import com.shigui.news.model.Comment;
import com.shigui.news.model.News;
import com.shigui.news.service.CommentService;
@Service("commentService")
public class CommentServiceImpl implements CommentService {

	@Autowired
	private CommentDao commentDao;
	
	@Override
	public Comment selectById(Integer id) {

		return commentDao.selectById(id);
	}

	@Override
	public List<Comment> select() {

		return null;
	}

	
	@Override
	public void insert(Comment comment) {

		commentDao.insert(comment);
		
	}

	@Override
	public void update(Comment comment) {

		commentDao.update(comment);
		
	}
	

	@Override
	public void delete(Comment comment) {

		commentDao.delete(comment);
		
	}



	@Override
	public List<Comment> getCommentsList(Integer newsId) {
		// TODO Auto-generated method stub
		return commentDao.getCommentList(newsId);
	}

	@Override
	public void delete(Integer newsId) {

		commentDao.delete(newsId);
	}

	@Override
	public List<Comment> select(News news, Integer page, Integer count) {
		// TODO Auto-generated method stub
		return commentDao.select(news, page, count);
	}

	@Override
	public Integer countCommentsList(News news) {
		
		return commentDao.countCommentsList(news);
	}

	@Override
	public Integer getCountListIntegerByNews(News news) {

		return commentDao.countCommentsList(news);
	}
	
	

}
